<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?php echo $pageNum ?>" />
	<input type="hidden" name="numPerPage" value="<?php echo $limit ?>" />
	<input type="hidden" name="orderField" value="<?php echo $field ?>" />
	<input type="hidden" name="orderDirection" value="<?php echo $order_by ?>" />
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?php echo site_url('backend/product/index'); ?>" method="post">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>商品名称：</label>
					<input type="text" name="name" value="<?php echo $this->input->post('name') ?>"/>
				</li>
				<li>
					<select name="category_id" class="combox">
						<option value="">所有分类</option>
						<?php echo $this->html_helper->select($categoryList, $this->input->post('category_id'))?>
					</select>
				</li>
				<li>
					<select class="combox" name="status">
						<option value="">所有状态</option>
						<?php echo $this->html_helper->select(array('10'=>'启用', '0'=>'禁用'),$this->input->post('status'));?>
					</select>
				</li>
			</ul>
			<div class="subBar right">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?php echo site_url('backend/product/multiAdd') ?>" target="navTab"><span>批量增加</span></a></li>
			<li><a class="add" href="<?php echo site_url('backend/product/add') ?>" target="navTab"><span>新增商品</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" postType="string" href="<?php echo site_url('backend/product/delete') ?>" class="delete"><span>批量删除</span></a></li>
			<li><a class="add" href="<?php echo site_url('backend/product/batchUpPrice?type=price') ?>" rel="ids" postType="string" targetType="createDialog" target="selectedTodo" width="600" height="150"><span>批量修改价格</span></a></li>
			<li><a class="edit" href="<?php echo site_url('backend/product/edit?id={sid_user}'); ?>" target="dialog" width="800" height="600" warn="请选择一个用户"><span>编辑商品</span></a></li>
			<li class="line">line</li>
			<li><a class="icon" href="javascript:;" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="112">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th orderField="id" class="<?php echo $order_by ?>">ID</th>
				<th>产品图片</th>
				<th>产品名称</th>
				<th>商品货号</th>
				<th>商品规格</th>
				<th>商品单价/元</th>
				<th>状态</th>
				<th>库存</th>
				<th>热销</th>
				<th width="80">热销图片</th>
				<th>限购/数量</th>
				<th>商品分类</th>
				<th>创建日期</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody class="gridImg">
			<?php foreach ($data as $al): ?>
				<tr target="sid_user" rel="<?php echo $al['id'] ?>">
					<td><input name="ids" value="<?php echo $al['id'] ?>" type="checkbox"></td>
					<td><?php echo $al['id'] ?></td>
					<td><a title="商品图片" target="navTab" href="<?php echo site_url('backend/product/images?id=' . $al['id']); ?>" rel="backendproductimages" class="btnEdit" 
						   >商品图片</a><a href="<?php echo base_url($al['thumbnail']) ?>" data-target="fancybox" data-fancybox-group="gallery" title="<?php echo $al['name'] ?>"><img src="<?php echo base_url($al['thumbnail']) ?>" height="48"></a></td>
					<td data-target="editable" data-params='{"db":"product.name","default":"<?php echo $al['name'] ?>"}'></td>
					<td data-target="editable" data-params='{"db":"product.serial","default":"<?php echo $al['serial'] ?>"}'></td>
					<td data-target="editable" data-params='{"db":"product.specs","default":"<?php echo $al['specs'] ?>"}'></td>
					<td data-target="editable" data-params='{"db":"product.price","default":"<?php echo $al['price'] / 100.00 ?>"}'></td>
					<td data-target="editable" data-params='{"hrefAttribute":"<?php echo site_url('backend/product/UpAndDown')?>","html":"switch","db":"product.status","value":{"0":["下架","btnDel"],"10":["上架","btnSelect"]},"default":"<?php echo $al['status']?>"}'></td>
					<td data-target="editable" data-params='{"html":"amount","db":"product.stock","default":"<?php echo $al['stock']?>"}'></td>
					<td data-target="editable" data-params='{"html":"switch","db":"product.isHot","value":{"0":["否","btnDel"],"10":["是","btnSelect"]},"default":"<?php echo $al['isHot'] ?>"}'></td>
					<td><a href="<?php echo base_url($al['hot_img']) ?>" data-target="fancybox" data-fancybox-group="gallery" title="<?php echo $al['name'] ?>"><img src="<?php echo base_url($al['hot_img']) ?>" height="48"></a></td>
					<td><?php echo ($al['isLimit'] == 10)?"是 ({$al['limit_num']})":'否' ?></td>
					<td><?php echo $al['catename']; ?></td>
					<td><?php echo date('Y-m-d H:i:s', $al['created_at']) ?></td>
					<td>
						<a title="编辑" target="navTab" href="<?php echo site_url('backend/product/edit?id=' . $al['id']); ?>" class="btnEdit">编辑</a>
						<a title="删除" target="ajaxTodo" href="<?php echo site_url('backend/product/delete?ids=' . $al['id']); ?>" class="btnDel">删除</a>
					</td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
	
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage: this.value})">
				<?php foreach (array('20','50','100','200') as $v):?>
				<option value="<?php echo $v?>" <?php if($v==$limit):?>selected="selected"<?php endif;?>><?php echo $v?></option>
				<?php endforeach;?>
			</select>
			<span>条，共<?php echo $totalCount?>条</span>
		</div>

		<div class="pagination" targetType="navTab" totalCount="<?php echo $totalCount?>" numPerPage="<?php echo $limit?>" pageNumShown="10" currentPage="<?php echo $pageNum?>"></div>

	</div>
	
	
	
</div>